import React,{Component} from 'react';
import './clumn.css';
import fetch from 'isomorphic-fetch';
class GridExample extends Component{
  constructor(props){
    super(props);
    this.state={}
  }
  getUrlParam(name){
    let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    let hrefSeach='';
    if(window.location.href.indexOf('?')>0){
      hrefSeach = window.location.href.split('?')[1];
    }else{
      return;
    }
    let rl = hrefSeach.match(reg);
    if (rl != null) return decodeURI(rl[2]); return null;
  }
  componentDidMount(){
    fetch('this.props.url')
      .then(response=>response.json())
      .then(json=>{
        this.setState(json);
      })
      .catch((error) => {  
        console.error(error);  
      });  
  }
  render(){
    return (
      <ul className='clumn'>
        <li className='clumn_li'>
          <a href={this.props.clums1}>
              <h1>{'我们约吧'}</h1>
              <p>{'恋人家人好朋友'}</p>
              <div className='img'></div>
          </a>
        </li>
        <li className='clumn_li'>
          <a href={this.props.clums2}>
              <h1>{'低价超值'}</h1>
              <p>{'十元惠生活'}</p>
              <div className='img'></div>
          </a>
        </li>
        <li className='clumn_li'>
          <a href={this.props.clums3}>
              <h1>{'工作简餐'}</h1>
              <p>{'是会方便选择多'}</p>
              <div className='img'></div>
          </a>
        </li>
      </ul>
      )
  }
}
export default GridExample;